|
|
|
| |
|
|
|
|
You also see several internal data tables in this listing. The tables that start with "MSYS" are used by Microsoft Jet to keep track of indexes, relationships, table definitions, and so on. Do not attempt to read, delete, or modify these tables. Doing so can permanently damage your database. |
|
|
|
|
|
|
|
|
|
|
The actual properties you see on your screen my be different. There are many properties of the TableDef object. Most of them are easy to understand. You can search the Visual Basic online documentation for detailed listings on each of the properties. |
|
|
|
|
| |
|
|
|
|
You may see one or more properties in your TableDefs that are not documented in the Visual Basic online documents. This is because the Microsoft Jet DAO language allows programmers to invent and store their own custom properties. You may be looking at properties invented by some other application (Microsoft Access, MS Project, custom applications, and so on). |
|
|
|
|
|
|
|
|
|
|
Along with the CreateTable method of the database, there are five methods that you can apply to the TableDef object: |
|
|
|
|
|
|
|
|
·OpenRecordset enables you to open a Table, Dynaset, or Snapshot Recordset from the TableDef object. |
|
|
|
|
|
|
|
|
·RefreshLink updates and refreshes any attached table links for the TableDef object. |
|
|
|
|
|
|
|
|
·CreateProperty enables you to create and store a user-defined property. See the UDP example under the Database object elsewhere in this chapter. |
|
|
|
|
|
|
|
|
·CreateIndex enables you to add an index to the TableDef object. This method is covered in "The Index Data Object" section later in this chapter. |
|
|
|
|
|
|
|
|
·CreateField enables you to add a new field to an existing TableDef object. You learn more about this method in "The Field Data Object" section. |
|
|
|
|
|
|
|
|
Creating a New Table in the Database |
|
|
|
|
|
|
|
|
The code in Listing 9.15 enables you to create a very simple database and table. Add another command button to the form. Set its Name property to cmdCreateTable and its Caption property to &CreateTable. Add the code in Listing 9.15 to the cmdCreateTable_Click event. |
|
|
|
|
|